export const throttle = (fn: any, wait: any) => {
  let timer: any = null;
  return (...args: any) => {
    if (timer) return;
    timer = setTimeout(() => {
      fn.apply(this, args);
      timer = null;
    },wait);
  };
};